<template>
  <div class="home">
    <navbar></navbar>
    <div v-for="item in 10" :key="item">
      <taozi-header
        :style="'background:' + randomColor() + ';' + 'color:' + randomColor()"
        class="wow animate__backInLeft"
        data-wow-delay="1s"
      ></taozi-header>
      <test
        :style="'background:' + randomColor() + ';' + 'color:' + randomColor()"
        class="wow animate__backInRight"
      ></test>
    </div>
    <el-button @click="login">获取请求</el-button>
    <button @click="testapi">test</button>
    <el-button @click="routerPush">获取请求</el-button>

    <h1 class="animate__animated animate__bounce">An animated element</h1>

    <!-- <HelloWorld msg="Welcome to Your Vue.js App" /> -->
  </div>
</template>
<script>
// @ is an alias to /src
// import HelloWorld from "@/components/HelloWorld.vue";
import { wxlogin, testapi } from "../api/login";
export default {
  name: "Home",
  components: {
    // HelloWorld,
  },
  data() {
    return {};
  },
  mounted() {
    new this.$wow.WOW().init();
  },
  methods: {
    async login() {
      console.log(1221);
      let data = {
        username: "admin",
        password: "123456",
      };
      console.log("data", data);
      const res = await wxlogin(data);
      console.log(res);
    },
    testapi() {
      let data = {
        username: "admin",
        password: "123456",
      };
      testapi(data).then((res) => {
        console.log(res);
      });
    },
    routerPush() {
      this.$router.push({
        name: "About",
      });
    },
    randomColor() {
      const color = "#" + parseInt(Math.random() * 0xffffff).toString(16);
      return color;
    },
  },
};
</script>

<style lang="less" scoped>
.service_item {
  height: 100px;
}
</style>
